snapshot: Fix mixup when creating crossfade nodes
authorTimm Bäder <mail@baedert.org>
Mon, 2 Oct 2017 13:25:44 +0000 (15:25 +0200)
committerTimm Bäder <mail@baedert.org>
Mon, 2 Oct 2017 13:25:44 +0000 (15:25 +0200)
We need to set the progress on the end node.

gtk/gtksnapshot.c

index 3f95678c7a3a1312f221f76ea06ed49874a986ea..d846d7b0fb4ec166044288134faf13159ea0808b 100644 (file)
@@ -929,7 +929,6 @@ gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
                               ...)
 {
   const GtkSnapshotState *current_state = gtk_snapshot_get_current_state (snapshot);
-  GtkSnapshotState *start_state;
   GtkSnapshotState *end_state;
   char *str;
 
@@ -944,20 +943,20 @@ gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
   else
     str = NULL;
 
-  start_state = gtk_snapshot_push_state (snapshot,
-                                         str,
-                                         current_state->clip_region,
-                                         current_state->translate_x,
-                                         current_state->translate_y,
-                                         gtk_snapshot_collect_cross_fade_end);
-
   end_state = gtk_snapshot_push_state (snapshot,
-                                       g_strdup (str),
-                                       start_state->clip_region,
-                                       start_state->translate_x,
-                                       start_state->translate_y,
-                                       gtk_snapshot_collect_cross_fade_start);
+                                       str,
+                                       current_state->clip_region,
+                                       current_state->translate_x,
+                                       current_state->translate_y,
+                                       gtk_snapshot_collect_cross_fade_end);
   end_state->data.cross_fade.progress = progress;
+
+  gtk_snapshot_push_state (snapshot,
+                           g_strdup (str),
+                           end_state->clip_region,
+                           end_state->translate_x,
+                           end_state->translate_y,
+                           gtk_snapshot_collect_cross_fade_start);
 }
 
 static GskRenderNode *